#include <cmath>
#include <fstream>
#include "sv2_streamer.h"
#include <cmath>
#include <fstream>
#include <limits>
#include <vector>


using namespace std;


namespace sv2
{

  void StreamerCppNode::run()
  {
    while (this->is_running())
    {
      nlohmann::json image_json;
      nlohmann::json tgts_json;

      // 主线程阻塞，等待队里中出现数据
      std::unique_lock<std::mutex> lock(this->_full_queue_mtx);
      this->_full_cv.wait(lock, [this]
                          { return !this->_full_queue.empty(); });

      image_json = this->_full_queue.front();
      this->_full_queue.pop();
      cv::Mat image = sms::sms2cvimg(image_json);
      this->_vs.stream(image);

    }
  }
}
